<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/react.development.js"></script>
    <script src="js/react-dom.development.js"></script>
    <script src="js/babel.js"></script>
    <style>
        dl {
            margin: 0;
        }
        .friend-list {
            border: 1px solid #000000;
            width: 200px;
        }
        .friend-group dt {
            padding: 10px;
            background-color: rgb(64, 158, 255);
            font-weight: bold;
        }
        .friend-group dd {
            padding: 10px;
            display: none;
        }
        .friend-group.expanded dd {
            display: block;
        }
        .friend-group dd.checked {
            background: green;
        }
    </style>
</head>
<body>
<div id="root"></div>
<script type="text/babel">
// 实际工作中，我们只需要关注数据的变化，react 会帮助我们 同步视图
function App(){
    let [age,setAge] = React.useState(8);
    return (<div>
        name: kkb<br/>
        age: {age}<br/>
        <button
            onClick = {()=>{
                setAge(++age);
            }}
        >增加一岁</button>
    </div>)
}
ReactDOM.render(
    <App />, 
    document.querySelector("#root")
);
</script>      
</body>
</html>